package com.example;


import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.bean.SysUser;
import com.example.demo.view.SysUserMapper;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/springboot")
public class HelloController {
        private final Logger log = LoggerFactory.getLogger(this.getClass());
        @Autowired
        private SysUserMapper service;
        @RequestMapping(value = "/{name}", method = RequestMethod.GET)
        @ApiOperation(notes="test",value="测试")
        public String sayWorld(@PathVariable("name")  @ApiParam String name) {
                log.debug("debug："+name);
                log.warn("warning："+name);
                log.info("info："+name);
                log.error("error："+name);
                List<SysUser> userlist = new ArrayList<SysUser>();
                userlist = service.queryAll();
                for(SysUser i : userlist){
                        log.debug(i.toString());
                }
            return "Hello " + name;
        }
}
